Portable handheld electronic devices, such as the iPhone® multifunction device by Apple Inc., have a touch screen in their front face, where an earpiece speaker or receiver used for telephony is located. When the device is being held against the user's ear during a phone call, a proximity function automatically senses this condition using an infrared proximity sensor that is built into the device, and on that basis turns off the touch sensitive display screen of the device. The proximity function can also automatically determine or measure when the device has moved away from the user's ear, in which case the touch screen is re-activated. This is achieved by measuring the signals of the infrared proximity sensor's emitter and complementary detector, where the emitter transmits an infrared signal that is reflected by a nearby object (e.g., the user's head) and picked up by the detector. A stronger received signal may be interpreted by the proximity function to mean that the object is closer, while a weaker received signal means the object is farther away. Since an intensity of the infrared signals are used to determine the proximity of an object, optical crosstalk between the emitter and detector components can result in a false signal, and in turn an inaccurate proximity measurement. In some proximity sensor modules, a wall which serves as a light barrier is placed between the emitter and detector. In some cases, however, crosstalk may still occur through the wall.